home *** CD-ROM | disk | FTP | other *** search
/ The Games Machine 76 / XENIATGM66.iso / Indiana Jones / Indiana Jones.exe / RESOURCE / PREVIEW.GOB / cog_sol_ctrlrmwin.cog < prev    next >
Text File  |  1999-11-15  |  3KB  |  119 lines

  1. # Jones 3D Cog Script
  2. #
  3. # SOL_CtrlRmWin.cog
  4. #
  5. # [TRM]
  6. #
  7. # (C) 1999 LucasArts Entertainment Co. All Rights Reserved
  8. # ========================================================================================
  9.  
  10. symbols
  11.  
  12.     message     startup
  13.     message     entered
  14.     message     exited
  15.     message     damaged
  16.     
  17.     thing       t_Sound
  18.     thing       win_Targ        mask=0x408
  19.     
  20.     sector      sec_WinTarg0    linkID=1
  21.     sector      sec_WinTarg1    linkID=1
  22.     
  23.     surface     surf_Win1_0     mask=0x408
  24.     surface     surf_Win1_1     mask=0x408
  25.     
  26.     surface     surf_Win2_0
  27.     surface     surf_Win2_1
  28.     
  29.     material    mat1=sol_4cntrlrm_window_b.mat      local   # opaque big window
  30.     material    mat2=sol_4_wall_grate_b.mat         local   # small opaque window
  31.     material    mat3=sol_4cntrlrm_window_2.mat      local   # clear broken big window
  32.     
  33.     sound        snd_Shatter=shs_glassbreak.wav      local
  34.     
  35.     int         breakable=0     local
  36.     int         broken=0        local
  37.     int         canSee=0        local
  38.     int         win1=2          local
  39.     int         win2=2          local
  40.     int         i=0             local
  41.     int         x=0             local
  42.     
  43. end
  44.  
  45. # ========================================================================================
  46.  
  47. code
  48.  
  49. startup:
  50.  
  51.     SetThingFlags(win_Targ, 0x80000);
  52.  
  53.     if(GetPerformanceLevel() < 2)
  54.     {
  55.         for(i=0; i<win1; i=i+1)
  56.         {
  57.             SetSurfaceMat(surf_Win1_0[i], mat1);
  58.             ClearAdjoinFlags(surf_Win1_0[i], 1);     # no see
  59.         }
  60.         
  61.         for(x=0; x<win2; x=x+1)
  62.         {
  63.             SetSurfaceMat(surf_Win2_0[x], mat2);
  64.             ClearAdjoinFlags(surf_Win2_0[x], 1);     # no see
  65.         }
  66.     }
  67.     
  68.     else breakable = 1;
  69.  
  70.     return;
  71.         
  72. # ========================================================================================
  73.  
  74. entered:
  75.  
  76.     if((GetSenderID() == 1) && (canSee == 0) && (breakable == 1) && (broken == 0))
  77.     {
  78.         canSee = 1;
  79.         ClearThingFlags(win_Targ, 0x80000);
  80.     }
  81.  
  82.     return;
  83.  
  84. # ========================================================================================
  85.  
  86. exited:
  87.  
  88.     if((GetSenderID() == 1) && (canSee == 1) && (breakable == 1) && (broken == 0))
  89.     {
  90.         canSee = 0;
  91.         SetThingFlags(win_Targ, 0x80000);
  92.     }
  93.  
  94.     return;
  95.  
  96. # ========================================================================================
  97.  
  98. damaged:
  99.  
  100.     if(breakable == 1)
  101.     {
  102.         for(i=0; i<win1; i=i+1)
  103.         {
  104.             broken = 1;
  105.             PlaySoundThing(snd_Shatter, t_Sound, 1.0, 20, 80, 0x0040);
  106.             SetSurfaceMat(surf_Win1_0[i], mat3);
  107.             SetAdjoinFlags(surf_Win1_0[i], 2);     # move
  108.             SetAdjoinFlags(surf_Win1_0[i], 0x10);  # no player move
  109.             if(canSee == 1) DestroyThing(win_Targ);
  110.         }
  111.     }
  112.     
  113.     return;
  114.  
  115. # ========================================================================================
  116.  
  117. end
  118.  
  119.